﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GoogleMapsApiWebServices.Core
{
    public struct Location
    {
        public string Address;
        public Coordinate Coordinate;

        public Location(string address, Coordinate coordinate)
        {
            Address = address;
            Coordinate = coordinate;
        }

        public Location(string address)
        {
            Address = address;
            Coordinate = new Coordinate();
        }

        public override string ToString()
        {
            if (!String.IsNullOrWhiteSpace(Address))
                return Address;

            return String.Format("{0},{1}", Coordinate.Latitude, Coordinate.Longitude);
        }
    }
}
